{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=51
  Verdict: Accepted
}
uses 
	SysUtils, Math;
 
var  	
	i,ls,t:longint;
	a:array[0..2000010] of longint;
	f:boolean;
	s:string;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(s);
ls:=length(s);
f:=true;
t:=0;
for i:=1 to ls do
	if s[i]='(' then begin
		inc(t);
		a[t]:=1;
	end else
	if s[i]='[' then begin
		inc(t);
		a[t]:=2;
	end else 
	if s[i]='{' then begin
		inc(t);
		a[t]:=3;
	end else
	if s[i]=')' then begin
		if a[t]=1 then dec(t) else begin
			f:=false;
			break;
		end;
	end else
	if s[i]=']' then begin
		if a[t]=2 then dec(t) else begin
			f:=false;
			break;
		end;
	end else begin
		if a[t]=3 then dec(t) else begin
			f:=false;
			break;
		end;
	end;
if f and (t=0) then write('yes') else write('no');
end.